package com.wn.ziroombackend.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.wn.ziroombackend.entity.Admin;
import com.wn.ziroombackend.mapper.AdminMapper;
import com.wn.ziroombackend.service.AdminService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class AdminServiceImpl implements AdminService {

    @Autowired
    private AdminMapper adminMapper;

    @Override
    public Admin login(Admin admin) {
        LambdaQueryWrapper<Admin> adminLambdaQueryWrapper = new LambdaQueryWrapper<>();
        adminLambdaQueryWrapper.eq(Admin::getUsername, admin.getUsername());

        return  adminMapper.selectOne(adminLambdaQueryWrapper);


    }
}
